<extend name="Public/base"/>

<block name="body">
		<style>
			.status1 {background-color: #2d7200;}
			.status0 {background-color: #ff2610;}
		</style>
    <div class="main-title">
        <h2>管理 关注者 </h2>
    </div>

    <div class="cf">
        <button class="btn ajax-post confirm" url="{:U('del')}" target-form="ids">批 量 冻 结</button>
		<a class="btn" href="{:U('ucenter',array('type'=>'plus'))}">用 户 发 布 列</a>
		<a class="btn" href="{:U('ucenter',array('type'=>'canyu'))}">用 户 参 与 列</a>
		<a class="btn" href="{:U('ucenter',array('type'=>'marks'))}">用 户 收 藏 列</a>
        <!-- 高级搜索 -->
                		<select name="guanzhu">
				             <option value="1" selected>关注</option>
							 <option value="0">取消关注</option>
						</select> 
        <div class="search-form fr cf">
            <div class="sleft">
                <input type="text" name="title" class="search-input" value="{:I('title')}" placeholder="输入用户Openid UC名 昵称">
                <a class="sch-btn" href="javascript:;" id="search" url="__SELF__"><i class="btn-search"></i></a>
            </div>
        </div>
    </div>

    <div class="data-table table-striped">
        <form class="ids">
            <table>
                <thead>
                    <tr>
                        <th class="row-selected">
                            <input class="checkbox check-all" type="checkbox">
                        </th>
                        <th>ID</th>
                        <th>Openid</th>
						<th>UC名</th>
                        <th>昵称</th>
                        <th>分组</th>
                        <th>性别</th>
						<th>QQ</th>
                        <th>关注</th>
                        <th>状态</th>
                        <th>个人中心</th>
                    </tr>
                </thead>
                <tbody>
				<notempty name="list">
                <volist name="list" id="menu">
                    <tr>
                        <td><input class="ids row-selected" type="checkbox" name="id[]" value="{$menu.id}"></td>
                        <td>{$menu.id}</td>
                        <td>{$menu.fromusername}</td>
                        <td>{$menu.ucusername}</td>
                        <td>{$menu.nickname}</td>
                        <td>{$menu.cate_group}</td>
                        <td>{$menu['sex']?'男':'女'}</td>
						<td>{$menu.qq}</td>
                        <td>{$menu['follow']?'关注':'取消关注'}</td><!-- 暂不考虑可视化修改    后续添加  -->
                        <td>
						<a class="ajax-get" href="{:U('del?id='.$menu['id'])}"><span class="status{$menu.status}">状态</span></a>						
						</td>
                        <td>
                            Ta的&nbsp;&nbsp;[<a title="编辑" href="{:U('edit?id='.$menu['id'])}">&nbsp;信息&nbsp;</a>|<a title="收藏" href="{:U('ucenter',array('type'=>'plus','id'=>$menu['id']))}">&nbsp;发布&nbsp;</a>|<a title="收藏" href="{:U('ucenter',array('type'=>'canyu','id'=>$menu['id']))}">&nbsp;参与&nbsp;</a>|<a title="收藏" href="{:U('ucenter',array('type'=>'marks','id'=>$menu['id']))}">&nbsp;收藏&nbsp;</a>]
                        </td>
                    </tr>
                </volist>
				<else/>
				<td colspan="11" class="text-center"> aOh! 暂时还没有关注用户哦! </td>
				</notempty>
                </tbody>
            </table>
        </form>
        <!-- 分页 -->
        <div class="page">
             {$_page}
        </div>
    </div>
</block>

<block name="script">
    <script type="text/javascript">
        $(function() {
            //搜索功能
            $("#search").click(function() {
                var url = $(this).attr('url');
                var query = $('.search-form').find('input').serialize();
                query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g, '');
                query = query.replace(/^&/g, '');
                if (url.indexOf('?') > 0) {
                    url += '&' + query;
                } else {
                    url += '?' + query;
                }
                window.location.href = url;
            });
            //回车搜索
            $(".search-input").keyup(function(e) {
                if (e.keyCode === 13) {
                    $("#search").click();
                    return false;
                }
            });
            //导航高亮
            highlight_subnav('{:U('index')}');
            //点击排序
        	$('.list_sort').click(function(){
        		var url = $(this).attr('url');
        		var ids = $('.ids:checked');
        		var param = '';
        		if(ids.length > 0){
        			var str = new Array();
        			ids.each(function(){
        				str.push($(this).val());
        			});
        			param = str.join(',');
        		}

        		if(url != undefined && url != ''){
        			window.location.href = url + '/ids/' + param;
        		}
        	});
        });
//排序方法
function sort(id,num){
    $.get('{:U("Keywordview/sort")}', { id: id,num:num }, function(jsondata){
		var return_data  = eval(jsondata);
		$("#7_"+id).attr('value', return_data);
		location.reload();
	}); 
}
    </script>
</block>